package com.yequan.thread.pc;

public class Consumer extends Thread {

    private Table table;

    public Consumer(String name, Table table) {
        super(name);
        this.table = table;
    }

    @Override
    public void run() {
        while (true) {
            try {
                String cake = table.take();
                Thread.sleep(2000);
            } catch (InterruptedException e) {
                e.printStackTrace();
            }
        }
    }
}
